//
//  DetailTopTableViewCell.m
//  XRSquare
//
//  Created by UaenaMo on 2018/8/14.
//  Copyright © 2018年 UaenaMo. All rights reserved.
//

#import "DetailTopTableViewCell.h"

@interface DetailTopTableViewCell ()
{
    UIImageView * imageView;
    UILabel * attendLabel;
}
@end

@implementation DetailTopTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 200)];
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        imageView.clipsToBounds = YES;
        [self addSubview:imageView];
        
        attendLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 200 - 40, 100, 30)];
        attendLabel.textAlignment = NSTextAlignmentCenter;
        attendLabel.textColor = [UIColor whiteColor];
        attendLabel.backgroundColor = themeColor;
        attendLabel.layer.cornerRadius = 15;
        attendLabel.font = [UIFont systemFontOfSize:13];
        attendLabel.clipsToBounds = YES;
        [self addSubview:attendLabel];
    }
    return self;
}

+(CGFloat)height
{
    return 200;
}

-(void)loadData:(NSDictionary *)data
{
    NSString * string = [data objectForKey:@"pic"];
    [imageView sd_setImageWithURL:[NSURL URLWithString:string]];
    attendLabel.text = [NSString stringWithFormat:@"需要%@人参与",[data objectForKey:@"num"]];
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
